package com.qyl.hrm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.qyl.hrm.dto.Dept;
import com.qyl.hrm.mapper.DeptMapper;
import com.qyl.hrm.service.DeptService;
import com.qyl.hrm.utils.PageBean;

@Service
@Transactional
public class DeptServiceImpl implements DeptService {

	@Autowired
	private DeptMapper deptMapper;
	
	@Override
	public Integer getRecordCount(Dept dept) {
		
		return deptMapper.getRecordCount(dept);
	}

	@Override
	public void getDeptList(Dept dept, PageBean pageBean) {

		List<Dept> list = deptMapper.getDeptList(dept,pageBean);
		
		pageBean.setList(list);
	}

	@Override
	public int addDept(Dept dept) {

		return deptMapper.addDept(dept);
	}

	@Override
	public int deleteDept(Integer id) {

		return deptMapper.deleteDept(id);
	}

	@Override
	public Dept getDeptById(Integer id) {
		
		return deptMapper.getDeptById(id);
	}

	@Override
	public int updateDept(Dept dept) {

		return deptMapper.updateDept(dept);
	}

}
